
             
/**
 * 
 *
 * Copyright (c) 2012-2013 JLLT Corp. 2012-2013,All Rights Reserved.
 * This software is published under the 金麟龙腾商贸有限公司.
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file. 
 *
 * @File name:  TCategoryBrandDao.java 
 * @Create on:  2012-06-28 21:05:458
 * @Author      :  高宇舟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        package com.boho.ecp.base.dao;

            
import java.sql.Connection;
import java.util.List;

import cn.boho.framework.po.CQuery;
import cn.boho.framework.po.CQueryFactoryTool;
import cn.boho.framework.po.DAO;
            
        /**
 * 【类目品牌信息:T_CATEGORY_BRAND】的Dao操作类
 * 
 */
public class TCategoryBrandDao extends DAO {
	
	/**
 	 * 查询指定【类目品牌信息:T_CATEGORY_BRAND】信息
 	 * @param con 
 	 * @param atx
 	 * @return
 	 * @throws Exception
 	 * @date2012-07-11
     * @author 高宇舟
 	 */
 	public static List queryTCategoryBrandByCategoryID(Connection con,java.lang.Integer categoryId) throws Exception{
 		StringBuffer sql = new StringBuffer();
 		sql.append("select CB.BRAND_ID,CB.CATEGORY_ID,B.BRAND_NAME,B.BRAND_ICON,B.BRAND_URL from t_category_brand CB");
 		sql.append(" LEFT JOIN t_brand B on B.BRAND_ID = CB.BRAND_ID");
 		sql.append(" where B.IS_VALID = 1 and CB.IS_VALID = 1");
 		sql.append(" and CB.CATEGORY_ID = ?");
 		sql.append(" order by B.BRAND_SEQ, B.BRAND_ID");

 		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
 		query.setCommand(sql.toString());
 		query.setInt(1, categoryId);
 		logger.debug("TCategoryBrandDao.queryTCategoryBrandByCategoryID() SQL->"+sql.toString());
 		return query.getDynaBeanMapList("T_CATEGORY_BRAND", con);
 	}
	
}
